package server;

import java.io.IOException;

/**
 * @Author: Tao Zheng
 * @classNmae: LagouServlet
 * @packageName: server
 * @description:
 * @DATE: 2021/7/13 17:34
 */
public class LagouServlet extends HttpServlet {

    @Override
    public void doGet(Request request, Response response) {
        String content = "<h1>LagouServlet get</h1>";
        try{
            response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content));
        }catch (IOException e){
            e.printStackTrace();
        }
    }

    @Override
    public void doPost(Request request, Response response) {
        String content = "<h1>LagouServlet post</h1>";
        try{
            response.output((HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content));
        }catch (IOException e){
            e.printStackTrace();
        }
    }

    @Override
    public void services(Request request, Response response) throws Exception {
        super.services(request, response);
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destory() throws Exception {

    }
}
